<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/generic/taglibs.jsp"%>

<div class="header">
	
	<%-- Connexion/déconnexion --%>
	<div class="userinfo">
		<ss:secure roles="ADMIN">
		<a class="linkicon" href="${contextPath }${actionBean.adminUrl }"><img
				alt='${m:msg(bundle,"common.admin")}'
				title='${m:msg(bundle,"common.admin")}'
				src="${contextPath }/img/admin.png" />
		</a>
		</ss:secure>
	<c:choose>

		<c:when test="${not empty user }">
			<a class="linkicon" href="${contextPath }${actionBean.myspaceUrl }"><img
				alt='${m:msg(bundle,"common.myspace")}'
				title='${m:msg(bundle,"common.myspace")}'
				src="${contextPath }/img/config.png" /></a>
			<s:form action="${contextPath }${actionBean.loginUrl }">
				<s:hidden name="from">${actionBean.url }</s:hidden>
				<s:submit name="logout" value=""
					title='${m:msg(bundle,"common.logout")}' />
			</s:form>
		</c:when>

		<c:otherwise>
		
			<s:form action="${contextPath }${actionBean.loginUrl }" >
				<div><sd:text name="loginuser" placeholder='${m:msg(bundle,"common.login")}' /></div>
				<div><sd:password name="loginpassword" placeholder='${m:msg(bundle,"common.password")}' /></div>
				<div><s:submit name="login" value='${m:msg(bundle,"common.dologin")}' title='${m:msg(bundle,"common.dologin")}' /></div>
				<%-- <s:submit name="login" value="" title='${m:msg(bundle,"common.dologin")}' /> --%>
				
				<s:hidden name="from">${actionBean.url }</s:hidden>
				<s:errors globalErrorsOnly="false" ></s:errors>
			</s:form>
		
		</c:otherwise>
	</c:choose>
	</div>
	
	<%-- Titre --%>
	<%-- <h1><a href="${contextPath }${actionBean.homeUrl }"><fmt:message bundle="${bundle}" key="header.title" /></a></h1> --%>
	<h1><a class="logo-link" href="${contextPath }/"><img src="${contextPath }/img/afcp_logo.jpg" alt="<fmt:message bundle="${bundle}" key="header.title" />" /></a></h1>
	
	<%-- Menu --%>
	<ul class="navbar">
		<%-- <li><a href="${contextPath }${actionBean.homeUrl }"<c:if test="${actionBean.url == actionBean.homeUrl}"> class="current"</c:if>><fmt:message bundle="${bundle }" key="home.title" /></a></li> --%>
		<li><a href="${contextPath }${actionBean.membresUrl }"<c:if test="${actionBean.url == actionBean.membresUrl }"> class="current"</c:if>><fmt:message bundle="${bundle }" key="members.title" /></a></li>
		<%-- <ss:secure roles="ADMIN"><li><a href="${contextPath }${actionBean.adminUrl }"<c:if test="${actionBean.url == actionBean.adminUrl }"> class="current"</c:if>><fmt:message bundle="${bundle }" key="admin.title" /></a></li></ss:secure> --%>
	</ul>
	
	<%-- Recherche --%>
	<%-- <s:form action="${contextPath }${actionBean.membresUrl }" focus="q" class="search">
		<sd:text name="q" placeholder="Recherche de membres" value="${actionBean.query }"/>
		<input type="submit" value="" title="Lancer la recherche" />
	</s:form> --%>
	<c:if test="${not (actionBean.homeUrl == actionBean.url) }">
		<jsp:include page="${contextPath }/WEB-INF/jsp/component/searchForm.jsp"></jsp:include>
	</c:if>
	
	<%-- faire une zone visible seulement par l'administrateur --%>
	<%-- <ss:secure roles="${actionBean.roleAdmin }"><p>Vous êtes connecté avec un compte administrateur. <a href="/admin">Page d'administration</a></p></ss:secure> --%>
</div>